﻿using System;
using System.Windows;
using Microsoft.Phone.Controls;

using Lastfm7.Services;

namespace Lastfm7
{
    public partial class MainPage : PhoneApplicationPage
    {
        public MainPage()
        {
            InitializeComponent();
            LastfmService.Instance.LoginSuccess += (s, e)
                => NavigationService.ToProfilePage();

            LastfmService.Instance.Error += (s, e)
                => MessageBox.Show(e.Item.Message, "LAST.FM APP", MessageBoxButton.OK);
        }

        void loginButton_Click(object sender, RoutedEventArgs e)
        {
            LastfmService.Instance.TryLogin(usernameBox.Text, passwordBox.Password);
        }
    }
}
